class RPGW extends SRKFWeaponShotgun;

simulated event WeaponTick(float dt)
{
	local KFPlayerReplicationInfo KFPRI;
	KFPRI = KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
	if(KFPRI.ClientVeteranSkillLevel<13 && !KFPRI.bAdmin)
	{
		Destroy();
	}
	if(AmmoAmount(0) == 0)
		MagAmmoRemaining = 0;
	super.Weapontick(dt);
}

/*simulated function HideRocket (name boneName)
{
	local int BoneScaleSlot;
	local bool bValidBoneToHide;
	if( boneName == 'Rocket' )
	{
		boneScaleSlot = 0;
		bValidBoneToHide = true;
	}
	if( bValidBoneToHide || AmmoAmount(0) <= 0)
	{
		SetBoneScale(BoneScaleSlot, 0.0, BoneName);
	}

}*/

simulated function BringUp(optional Weapon PrevWeapon)
{
	Super.BringUp(PrevWeapon);

	if ( MagAmmoRemaining >= 1)
		SetBoneScale (0, 1.0, 'Rocket');
	else 
		SetBoneScale (0, 0.0, 'Rocket');
}

function Notify_EGpHideRocket ()
{
	if (AmmoAmount(0) <= 0)
		SetBoneScale (0, 0.0, 'Rocket');
}

simulated function bool PutDown()
{
	if (Super.PutDown())
	{
		if (MagAmmoRemaining < 1)
			SetBoneScale (0, 0.0, 'Rocket');

		return true;
	}
	return false;
}

function PlayIdle()
{
	if (MagAmmoRemaining >= 1)
		SetBoneScale (0, 1.0, 'Rocket');
	else 
		SetBoneScale (0, 0.0, 'Rocket');
}

simulated function ClientReload()  
{
		if (MagAmmoRemaining < 1 || AmmoAmount(0) <= 0)
		{
			PlayAnim('Reload', ReloadAnimRate, 0.1);
			SetBoneScale (0, 1.0, 'Rocket');
		}
		else
		{
			SetBoneScale (0, 1.0, 'Rocket');
		}
}

simulated function ZoomIn(bool bAnimateTransition)
{
	if( Level.TimeSeconds < FireMode[0].NextFireTime )
	{
		return;
	}

	super.ZoomIn(bAnimateTransition);

	if( bAnimateTransition )
	{
		if( bZoomOutInterrupted )
		{
			PlayAnim('Raise',1.0,0.1);
		}
		else
		{
			PlayAnim('Raise',1.0,0.1);
		}
	}
}

simulated function ZoomOut(bool bAnimateTransition)
{
	super.ZoomOut(false);

	if( bAnimateTransition )
	{
		TweenAnim(IdleAnim,FastZoomOutTime);
	}
}

defaultproperties
{
     MagCapacity=1
     ReloadRate=0.010000
     ReloadAnim="Reload"
     ReloadAnimRate=1.150000
     bHoldToReload=False
     bDoSingleReload=True
     NumLoadedThisReload=1
     WeaponReloadAnim="Reload_Crossbow"
     MinimumFireRange=200
     HudImage=Texture'SCTextures.rpg_unselected'
     SelectedHudImage=Texture'SCTextures.RPG'
     bIsReloading=True
     bAimingRifle=True
     bHasAimingMode=True
     IdleAimAnim="Idle"
     StandardDisplayFOV=75.000000
     bModeZeroCanDryFire=True
     SleeveNum=0
     TraderInfoTexture=Texture'SCTextures.BigIcon_RPG'
     PlayerIronSightFOV=90.000000
     ZoomTime=0.260000
     ZoomedDisplayFOV=65.000000
     FireModeClass(0)=Class'PerksSimHostOrg.RPGWFire'
     FireModeClass(1)=Class'KFMod.NoFire'
     SelectAnim="Pullout"
     PutDownAnim="Putaway"
     SelectSound=Sound'KF_LAWSnd.LAW_Select'
     SelectForce="SwitchToRocketLauncher"
     AIRating=0.750000
     CurrentRating=0.750000
     bSniping=False
     Description="RPG-7"
     EffectOffset=(X=0.100000,Y=-10.000000,Z=0.100000)
     DisplayFOV=75.000000
     Priority=199
     HudColor=(G=0)
     InventoryGroup=4
     GroupOffset=4
     PickupClass=Class'PerksSimHostOrg.RPGWPickup'
     PlayerViewOffset=(X=16.000000,Y=20.000000,Z=-18.000000)
     BobDamping=1.800000
     AttachmentClass=Class'PerksSimHostOrg.RPGWAttachment'
     IconCoords=(X1=429,Y1=212,X2=508,Y2=251)
     ItemName="RPG-7"
     Mesh=SkeletalMesh'RPG7DT_A.RPG7'
     AmbientGlow=2
}
